package org.charles.zhifou.model.dto.app;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.charles.zhifou.enums.AppTypeEnum;
import org.charles.zhifou.common.enums.CodeToEnumDeserializer;
import org.charles.zhifou.enums.ScoringStrategyEnum;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 * 创建应用请求
 *
 * @author Charles
 * @version 1.0
 */
@Data
public class AppAddRequest implements Serializable {

    @Schema(description = "应用名")
    @Length(min = 1, max = 80, message = "应用名不能为空且长度不能超过 80 个字符")
    private String appName;

    @Schema(description = "应用描述")
    private String appDesc;

    @Schema(description = "应用图标")
    private String appIcon;

    @Schema(description = "应用类型: 0-得分类, 1-测评类")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private AppTypeEnum appType;

    @Schema(description = "评分策略: 0-自定义, 1-AI")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private ScoringStrategyEnum scoringStrategy;

    @Serial
    private static final long serialVersionUID = 1L;
}